]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
overview: Center the dash vertically
authorJoost Verdoorn <jpverdoorn@gmail.com>
Mon, 13 Aug 2012 14:18:38 +0000 (16:18 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Mon, 20 Aug 2012 12:23:19 +0000 (14:23 +0200)
https://bugzilla.gnome.org/show_bug.cgi?id=682109

js/ui/dash.js
js/ui/overview.js
js/ui/viewSelector.js

index f4c033bad8db69b3a705b7eb3631182f2d13bdcc..bc98ae323517746eb81d9c8a996fce7fa04c0acb 100644 (file)
@@ -331,8 +331,7 @@ const Dash = new Lang.Class({
 
         this._container.add(this._showAppsIcon.actor);
 
-        this.actor = new St.Bin({ child: this._container,
-                                  y_align: St.Align.START });
+        this.actor = new St.Bin({ child: this._container });
         this.actor.connect('notify::height', Lang.bind(this,
             function() {
                 if (this._maxHeight != this.actor.height)
index a7d29109a2afb869e5c12bf0ce6be4a0e5acd1cb..cb0ff67d91261e3aed9aecec72d6ba755d47b392 100644 (file)
@@ -202,7 +202,6 @@ const Overview = new Lang.Class({
         this._group.add_actor(this._dash.actor);
 
         // TODO - recalculate everything when desktop size changes
-        this._dash.actor.add_constraint(this._viewSelector.constrainY);
         this._dash.actor.add_constraint(this._viewSelector.constrainHeight);
         this.dashIconSize = this._dash.iconSize;
         this._dash.connect('icon-size-changed',
@@ -494,12 +493,7 @@ const Overview = new Lang.Class({
         let searchY = contentY + this._spacing;
 
         let dashWidth = Math.round(DASH_SPLIT_FRACTION * primary.width);
-        let viewWidth = primary.width - dashWidth - this._spacing;
-        let viewHeight = contentHeight - 2 * this._spacing - searchHeight;
-        let viewY = contentY + this._spacing + searchHeight;
-        let viewX = rtl ? 0 : dashWidth + this._spacing;
-
-        // Set the dash's x position - y is handled by a constraint
+        let dashY = searchY + searchHeight + this._spacing;
         let dashX;
         if (rtl) {
             this._dash.actor.set_anchor_point_from_gravity(Clutter.Gravity.NORTH_EAST);
@@ -507,9 +501,14 @@ const Overview = new Lang.Class({
         } else {
             dashX = 0;
         }
-        this._dash.actor.set_x(dashX);
+
+        let viewX = rtl ? 0 : dashWidth + this._spacing;
+        let viewY = searchY + searchHeight + this._spacing;
+        let viewWidth = primary.width - dashWidth - this._spacing;
+        let viewHeight = contentHeight - this._spacing - viewY;
 
         this._searchEntry.set_position(searchX, searchY);
+        this._dash.actor.set_position(dashX, dashY);
         this._viewSelector.actor.set_position(viewX, viewY);
         this._viewSelector.actor.set_size(viewWidth, viewHeight);
     },
index 9fa47629e5fe6b339acb06c1b5da7c2d9bde8722..38326a59b22c130cb7b1e8ff49c455a20fb5c136 100644 (file)
@@ -422,8 +422,6 @@ const ViewSelector = new Lang.Class({
         // to use position and height properties directly, outside code would
         // need to ensure that the content is properly allocated before
         // accessing the properties.
-        this.constrainY = new Clutter.BindConstraint({ source: this._pageArea,
-                                                       coordinate: Clutter.BindCoordinate.Y });
         this.constrainHeight = new Clutter.BindConstraint({ source: this._pageArea,
                                                             coordinate: Clutter.BindCoordinate.HEIGHT });
     },